package com.example.cxx.zhuce;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Login extends Activity {
    private Button btnReg;
    private List<Student> stuList;
    private String stuPassword;
    private EditText name;
    private EditText pwd;
    private Student stu;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        name=(EditText)findViewById(R.id.et_name);
        pwd=(EditText)findViewById(R.id.et_password);

        String stuname=name.getText().toString();
        Student stu=new Student(stuname,stuPassword);
    }

        public void exam (View view){
            String stuname=name.getText().toString();
            if (stuname.equals(stu)){
                Log.i("RegLog","登录成功");
                Toast.makeText(Login.this,"登录成功",Toast.LENGTH_LONG).show();

            }else{
                Log.i("RegLog","登录成功");
                Toast.makeText(Login.this,"登录成功",Toast.LENGTH_LONG).show();
                Intent intent = new Intent();
                intent.setClass(Login.this, Exam.class);
                startActivity(intent);
            }
        }
    }
